<?phpif (!defined('BASEPATH'))	exit('No direct script access allowed');
// ------------------------------------------------------------------------
/**
 * Display Message
 *
 * Create a local URL based on your basepath. Segments can be passed via the
 * first parameter either as a string or an array.
 *
 * @access	public
 * @param	string
 * @return	string
 */
if (!function_exists('is_logged_in')) {
	function is_logged_in() {
		$CI = &get_instance();
		$is_logged_in = $CI -> session -> userdata('is_logged_in');
		if (!isset($is_logged_in) || $is_logged_in != true) {
			$CI -> session -> set_flashdata('message', array('title' => '<i class="icon-lock"></i> Access denied', 'content' => 'You are not allowed to access the admin section of this site, please contact the administrator', 'type' => ALERT_TYPE_ERROR));
			redirect('login/index');
		}
	}}?>